package ro.dandanciu.webgallery.services;

import java.util.List;

import ro.dandanciu.webgallery.domainmodel.Gallery;
import ro.dandanciu.webgallery.domainmodel.User;

public interface GalleryServices {

	/**
	 * Persists an object of type gallery.
	 * @param gallery the gallery which needs to be added in the database.
	 */
	void save(Gallery gallery);
	
	/**
	 * Returns a list containing all the galleries by owner.
	 * @param owner the owner for whom we want to retries the galleries.
	 * @param the parent gallery identifier, if smaller than 0 the root galleries
	 * will be returned
	 * @return
	 */
	List<Gallery> getGalleriesByOwner(User owner, long galleryId, String filter);

	/**
	 * 
	 * @param galleryId
	 * @return
	 */
	Gallery getGalleryById(long galleryId);
	
	/**
	 * 
	 * @param filter
	 * @return
	 */
	List<Gallery> getPublicGalleries(String filter);

	/**
	 * 
	 * @param gallery
	 */
	void update(Gallery gallery);

	/**
	 * 
	 * @param ownerUserId
	 * @param galleryName
	 * @return
	 */
	Gallery getGalleryByOwnerAndName(String ownerUserId, String galleryName);

	/**
	 * 
	 * @param gallery
	 * @return
	 */
	String getFsPathForGallery(Gallery gallery);
	
	/**
	 * Delete one or multiple galleries.
	 * @param long1 var-args array with the ids.
	 */
	void delete(Long...long1);
}
